#include "group.h"
#include <vector>
using namespace std;

Group::Group(int objnum)
{
	objectNumber = objnum;
}

bool Group::intersect(const Ray &r, Hit &h, float tmin)
{
	bool tmp = false;
	for(int i=0; i<objectNumber; i++)
		if(objects[i]!=NULL)
		if(objects[i]->intersect(r, h, tmin))
			tmp = true;

	return tmp;
}

void Group::addObject(int index, Object3D *obj)
{
	objects[index] = obj;
}
